home *** CD-ROM | disk | FTP | other *** search
/ Sesame Street - Season 38 Press Kit / Sesame Street - Season 38 Press Kit CD-ROM.iso / mac.swf / scripts / frame_153 / DoAction.as
Encoding:
Text File  |  2007-06-07  |  3.7 KB  |  152 lines

  1. function checkTheCount()
  2. {
  3.    if(current == 8)
  4.    {
  5.       theCount.scaleTo(200,1,"easeInOutBack");
  6.    }
  7.    else
  8.    {
  9.       theCount.scaleTo(100,0.5,"easeOutSine");
  10.    }
  11. }
  12. function select()
  13. {
  14.    i = 0;
  15.    while(i <= muppet.length - 1)
  16.    {
  17.       if(currentMuppet == eval(muppet[i]))
  18.       {
  19.          currentMuppet.art.gotoAndStop(1);
  20.          currentMuppet.onEnterFrame = function()
  21.          {
  22.             this._y += (600 - this._y) / 3;
  23.             if(this._y < 602)
  24.             {
  25.                this.gotoAndPlay(2);
  26.                delete this.onEnterFrame;
  27.             }
  28.          };
  29.       }
  30.       else if(eval(muppet[i]) != _level0.theCount)
  31.       {
  32.          eval(muppet[i]).onEnterFrame = function()
  33.          {
  34.             this._y += (850 - this._y) / 3;
  35.             if(this._y > 849)
  36.             {
  37.                this.gotoAndStop(1);
  38.                delete this.onEnterFrame;
  39.             }
  40.          };
  41.       }
  42.       else
  43.       {
  44.          theCount.art.gotoAndPlay(2);
  45.          theCount.gotoAndStop(1);
  46.       }
  47.       i++;
  48.    }
  49. }
  50. function runBrowse()
  51. {
  52.    currentMuppet = noMuppet;
  53.    select();
  54.    i = 0;
  55.    while(i <= muppet.length - 1)
  56.    {
  57.       eval(muppet[i]).onEnterFrame = function()
  58.       {
  59.          this._y += (850 - this._y) / 3;
  60.          if(this._y > 849.5)
  61.          {
  62.             delete this.onEnterFrame;
  63.          }
  64.       };
  65.       i++;
  66.    }
  67.    i = 0;
  68.    while(i <= leftWordArray.length - 1)
  69.    {
  70.       var leftWords = leftWordCage["lw" + i];
  71.       var rightWords = rightWordCage["rw" + i];
  72.       leftWords.enabled = false;
  73.       rightWords.enabled = false;
  74.       leftWords.art.tween("_x",0,0.5,"easeInBack");
  75.       rightWords.art.tween("_x",0,0.5,"easeInBack");
  76.       i++;
  77.    }
  78.    topBubble.tween("_x",80,1,"easeInOutBack",0.5);
  79.    browseBtn.scaleTo(75,0.5,"easeInBack");
  80.    browseBtn.tween(["_y","_x"],[134,33],1,"easeInBack");
  81.    downloadBtn.scaleTo(75,0.5,"easeInBack");
  82.    downloadBtn.tween(["_y","_x"],[262,31],1,"easeInBack");
  83.    cover0.scaleTo(0,0.5,"easeInBack");
  84.    cover1.scaleTo(0,0.5,"easeInBack");
  85.    cover0.tween(["_y","_x"],[187,69],0,"linear",0.5);
  86.    cover1.tween(["_y","_x"],[299,136],0,"linear",0.5);
  87.    cover0.scaleTo(70,0.5,"easeOutBack",1);
  88.    cover1.scaleTo(70,0.5,"easeOutBack",1);
  89.    grab.alphaTo(100,0.5,"linear",2);
  90. }
  91. stop();
  92. theCount.tween("_y",600,0.5,"easeInSine");
  93. i = 0;
  94. while(i <= 1)
  95. {
  96.    tg = 0.2 * i;
  97.    this["cover" + i].scaleTo(100,0.5,"easeOutBack",tg);
  98.    i++;
  99. }
  100. topBubble.masker.scaleTo(100,0.4,ease);
  101. browseBtn.masker.scaleTo(150,0.4,ease,0.4);
  102. downloadBtn.masker.scaleTo(150,0.4,ease,0.8);
  103. angleX = 0;
  104. angleY = 0;
  105. range = 10;
  106. xspeed = 0.07;
  107. yspeed = 0.11;
  108. browseBtn.onEnterFrame = function()
  109. {
  110.    browseBtn.art._x = -4 + Math.sin(angleX) * range;
  111.    browseBtn.art._y = -3 + Math.sin(angleY) * range;
  112.    downloadBtn.art._x = 0 + Math.sin(angleX) * (- range);
  113.    downloadBtn.art._y = 0 + Math.sin(angleY) * (- range);
  114.    angleX += xspeed;
  115.    angleY += yspeed;
  116. };
  117. browseBtn.enabled = true;
  118. browseBtn.onRelease = browseBtn.onReleaseOutside = function()
  119. {
  120.    topBubble.enabled = true;
  121.    getUrl("GRAB/html/index.html", "_self");
  122. };
  123. downloadBtn.onRollOver = function()
  124. {
  125.    this.art.gotoAndStop(2);
  126. };
  127. downloadBtn.onRollOut = function()
  128. {
  129.    this.art.gotoAndStop(1);
  130. };
  131. downloadBtn.onRelease = downloadBtn.onReleaseOutside = function()
  132. {
  133.    this.art.gotoAndStop(1);
  134.    this.enabled = false;
  135.    runBrowse();
  136. };
  137. topBubble.enabled = false;
  138. topBubble.onRollOver = function()
  139. {
  140.    this.gotoAndStop(2);
  141. };
  142. topBubble.onRollOut = function()
  143. {
  144.    this.gotoAndStop(1);
  145. };
  146. topBubble.onRelease = topBubble.onReleaseOutside = function()
  147. {
  148.    gotoAndStop("reset");
  149.    play();
  150.    this.enabled = false;
  151. };
  152.